package com.xxwy.extensible.xml.main;

import com.xxwy.extensible.xml.bean.User;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;

import java.util.Map;

/**
 * 扩展xml解析.
 *
 * @author xxwy
 * @date 2021/8/3 0003
 */
public class ExtensibleDemo {

    public static void main(String[] args) {
        DefaultListableBeanFactory listableBeanFactory = new DefaultListableBeanFactory();
        XmlBeanDefinitionReader definitionReader = new XmlBeanDefinitionReader(listableBeanFactory);
        definitionReader.loadBeanDefinitions("META-INF/spring-extensible.xml");
        Map<String, User> beansOfType = listableBeanFactory.getBeansOfType(User.class);
        System.out.println(beansOfType);

    }
}
